package br.com.center.loja.auth;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;

import br.com.center.loja.model.Permission;

public class Rule implements Serializable {

	private static final long serialVersionUID = 1L;

	@Element(required=true)
	private String url;

	@ElementList(inline=true, required=true)
	private List<Permission> permissions;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Permission> getPermissions() {
		if (permissions == null){
			permissions = new ArrayList<Permission>();
		}
		
		return permissions;
	}

	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}

}
